package com.suliao.home.serviceImpl.industry;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.suliao.home.entity.industry.InfoDownloadDO;
import com.suliao.home.mapper.industry.InfoDownloadMapper;
import com.suliao.home.service.industry.InfoDownloadService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author： M1nG-CodeGenerator
 * @since： 2020-12-14 16:10:11
 * @description： 下载资料表 服务实现类
 * @version： 1.0
 */
@Service
public class InfoDownloadServiceImpl extends ServiceImpl<InfoDownloadMapper, InfoDownloadDO> implements InfoDownloadService {

    @Autowired
    private InfoDownloadMapper infoDownloadMapper;

    /**
     * 通过公司id和资料分页分类查询“下载资料表”信息
     * @param pageInfo
     * @param companyId
     * @param type
     * @return
     */
    @Override
    public Page<InfoDownloadDO> getExhibitDownloadList(Page pageInfo, Integer companyId, Integer type) {
        return infoDownloadMapper.getExhibitDownloadList(pageInfo,companyId,type);
    }

    /**
     * 查询推荐下载
     * @param companyId
     * @return
     */
    @Override
    public List<InfoDownloadDO> queryRecommendDownLoad(Integer companyId) {
        return infoDownloadMapper.queryRecommendDownLoad(companyId);
    }

    /**
     * 通过id更新资料下载量
     * @param id
     * @return
     */
    @Override
    public Integer updateDownLoadNumber(Integer id) {
        return infoDownloadMapper.updateDownLoadNumber(id);
    }
}
